<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>gcd</title>
</head>

<body>
    <script>
        const gcd = (...arr) => {
            const _gcd = (x, y) => (!y ? x : gcd(y, x % y));
            return [...arr].reduce((a, b) => _gcd(a, b));
        };
        const a = 8, b = 36;
        document.writeln(`a=${a},b=${b},两者之间的最大公约数是${gcd(8, 36)}`)
    </script>
</body>

</html>